import { createApp } from "vue";
import App from "./App.vue";

import { router } from "./router/index"; // router

import store from "./store"; // store

import directive from "./directive/index"; // directive

import useElementUi from "./elementui"; // 按需引入element-ui

import "./core/permission"; // 动态校验路由

import "./stylus/index.styl"; // css文件

import svgIcon from "./plugin/icons/svgIcon.vue"; // svg文件
// import ElementPlus from "element-plus";
// import zhCn from "element-plus/es/locale/lang/zh-cn";

// import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const app = createApp(App);

directive(app); // 放在mount上面，有顺序的

useElementUi(app); // 引用element-ui

app.component("svg-icon", svgIcon);

// app.use(ElementPlus, {
//     locale: zhCn,
//   });
//   for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//     app.component(key, component);
//   }
app.use(store);

app.use(router);

app.mount("#app");
